#ifndef OBJECT_TABLE_H
#define OBJECT_TABLE_H

#include <object.h>

struct object_table_entry {

#define OBJECT_TYPE_UNDEFINED           0
#define OBJECT_TYPE_LINE                1
#define OBJECT_TYPE_CIRCLE              2
#define OBJECT_TYPE_ELLIPSE             3
#define OBJECT_TYPE_POLYGON             4

  uint16_t type;

  char *name;
  struct object_ops {
    object_t *     (*new)     ( void );
    void           (*free)    ( object_t *object );
    char *         (*str)     ( object_t *object );
    void           (*draw)    ( object_t *object, surface_t *surface );
  } ops;
};


struct object_table_entry *
add_object_table_entry( const char *name, const struct object_ops *ops );

struct object_table_entry *
get_object_table_entry( uint16_t type );

void
clear_object_table( void );

#endif /* OBJECT_TABLE_H */
